﻿using System;
using System.Collections.Generic;
using System.Text;

namespace UtilZ.Dotnet.Ex.Communication.Net.Telnet.Commands
{
    /// <summary>
    /// 获取编码命令
    /// </summary>
    [TelnetCommandAttribute(TelnetCommandConstant.GET_TELNET_INFO)]
    internal class GetTelnetInfoCommand : TelnetCommandAbs
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public GetTelnetInfoCommand()
            : base()
        {

        }

        /// <summary>
        /// 执行命令[执行成功返回true;否则返回false]
        /// </summary>
        /// <param name="telnetClient">执行命令的连接</param>
        /// <param name="paraArr">命令参数</param>
        /// <returns>执行结果</returns>
        protected override bool PrimitiveExcute(IListenTelnetClient telnetClient, string[] paraArr)
        {
            string info = telnetClient.GetTelnetInfo();            
            telnetClient.SendMessage(info);
            return true;
        }
    }
}
